<template>
  <div style="display: flex">
    <!-- 面包屑指引 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>活动管理</el-breadcrumb-item>
      <el-breadcrumb-item>活动列表</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 先准备一个盒子 -->
    <div id="main" style="width: 900px; height: 600px"></div>
  </div>
</template>

<script>
//引入echarts
import * as echarts from 'echarts';
export default {
  data() {
    return {};
  },

  async mounted() {
    //获取准备好的盒子，初始化echarts实例
    var myechars = echarts.init(document.getElementById("main"));
    //请求服务器数据
    let {data} = await this.$req.get("/reports/type/1");
    console.log(data);
    //绘制图标,饼图
    var option = data.data;
    //使用指定的配置项和数据显示图标
    myechars.setOption(option);
  },
};
</script>

<style>
</style>